import request from "@/api/request.js";

export const userRegisterService = DataObj => {
  //借助urlsearchParams完成传递
  const params = new URLSearchParams();
  for (let key in DataObj) {
    params.append(key, DataObj[key]);
  }
  console.log("register" + params);
  return request.post("/api-self/users/register", params);
};

//登录接口
export const userLoginService = loginData => {
  return request.post("/api-self/users/login", JSON.stringify(loginData), {
    headers: {
      "Content-Type": "application/json"
    }
  });
};
